using UnityEngine;
using System.Collections;

public class MixMotor : ZigZagMotor 
{
	public float DashSpeedMult = 1.5f;
	protected override void SetDirection (ref Vector3 dir)
	{
		var cols = Physics.RaycastAll(transform.position, Vector3.down);
		foreach(var col in cols)
		{
			if(col.collider.gameObject.tag == "Player")
			{
				dir += VerticalSpeed * DashSpeedMult * Time.deltaTime * Vector3.down;
				return;
			}
		}
		base.SetDirection(ref dir);
	}
}
